package com.sunyard.utils;

import com.sunyard.constant.ConfigConstants;

import java.io.IOException;
import java.util.Properties;

/**
 * @author mazhao
 * @ClassName PropertyUtil
 * @Package com.sunyard.util
 * @Description 读取properties文件的工具类
 * @Date 2018/11/29 10:58
 * @Version V1.0
 */
public class PropertyUtil {
    //系统参数
    private static Properties params = new Properties();

    /**
     * 读取properties配置文件信息 
     */
    static {
        try {
            params.load(PropertyUtil.class.getClassLoader().getResourceAsStream(ConfigConstants.SYSTEM_CONFIG));
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    /**
     * @param key
     * @return
     */
    public static String getParam(String key) {
        return params.getProperty(key);
    }
} 